{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<a href=\"https://user-images.githubusercontent.com/19553554/71825144-2d568180-30d6-11ea-8ee0-63c849cfd934.png\" target=\"_blank\"><img align=\"left\" style=\"width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;\"></a>\n",
    "*pyecharts 是一个用于生成 Echarts 图表的类库。Echarts 是百度开源的一个数据可视化 JS 库。用 Echarts 生成的图可视化效果非常棒，为了与 Python 进行对接，方便在 Python 中直接使用数据生成图，于是有人开发出了这个项目[GitHub](https://github.com/pyecharts/pyecharts) .*\n",
    "\n",
    "*Note.建议本程序在参看https://github.com/pyecharts/pyecharts 的安装步骤后再运行； 本程序所有的例子都是从官方提供的样例代码[GitHub](https://github.com/pyecharts/pyecharts-gallery)中提取的,如果对某个API有疑问建议在IDE里面查看*\n",
    "\n",
    "*Echart类型图种大全:https://echarts.apache.org/examples/zh/#chart-type-line pyecharts图导入到ppt中的方法:https://baijiahao.baidu.com/s?id=1663839456876951842&wfr=spider&for=pc.*\n",
    "\n",
    "*作者: LBQ; 时间:2020/7/24. 邮箱:779660843@qq.com*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# XXXI.旭日图(Sunburst)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基础示例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f41bca0d4ae2448b9b476339440e2fc8\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_f41bca0d4ae2448b9b476339440e2fc8 = echarts.init(\n",
       "                    document.getElementById('f41bca0d4ae2448b9b476339440e2fc8'), 'white', {renderer: 'canvas'});\n",
       "                var option_f41bca0d4ae2448b9b476339440e2fc8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"sunburst\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"Grandpa\",\n",
       "                    \"target\": \"blank\",\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"value\": 15,\n",
       "                            \"name\": \"Uncle Leo\",\n",
       "                            \"target\": \"blank\",\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"value\": 2,\n",
       "                                    \"name\": \"Cousin Jack\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                },\n",
       "                                {\n",
       "                                    \"value\": 5,\n",
       "                                    \"name\": \"Cousin Mary\",\n",
       "                                    \"target\": \"blank\",\n",
       "                                    \"children\": [\n",
       "                                        {\n",
       "                                            \"value\": 2,\n",
       "                                            \"name\": \"Jackson\",\n",
       "                                            \"target\": \"blank\"\n",
       "                                        }\n",
       "                                    ]\n",
       "                                },\n",
       "                                {\n",
       "                                    \"value\": 4,\n",
       "                                    \"name\": \"Cousin Ben\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"value\": 10,\n",
       "                            \"name\": \"Father\",\n",
       "                            \"target\": \"blank\",\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"value\": 5,\n",
       "                                    \"name\": \"Me\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                },\n",
       "                                {\n",
       "                                    \"value\": 1,\n",
       "                                    \"name\": \"Brother Peter\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Nancy\",\n",
       "                    \"target\": \"blank\",\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Uncle Nike\",\n",
       "                            \"target\": \"blank\",\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"value\": 1,\n",
       "                                    \"name\": \"Cousin Betty\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                },\n",
       "                                {\n",
       "                                    \"value\": 2,\n",
       "                                    \"name\": \"Cousin Jenny\",\n",
       "                                    \"target\": \"blank\"\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                0,\n",
       "                \"90%\"\n",
       "            ],\n",
       "            \"highlightPolicy\": \"descendant\",\n",
       "            \"nodeClick\": \"rootToNode\",\n",
       "            \"sort\": \"desc\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Sunburst-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_f41bca0d4ae2448b9b476339440e2fc8.setOption(option_f41bca0d4ae2448b9b476339440e2fc8);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7fc7a8674a20>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Sunburst\n",
    "from pyecharts import options as opts\n",
    "\n",
    "\"\"\"\n",
    "Gallery 使用 pyecharts 1.1.0\n",
    "参考地址: https://www.echartsjs.com/examples/editor.html?c=sunburst-simple\n",
    "\n",
    "目前无法实现的功能:\n",
    "\n",
    "1、\n",
    "\"\"\"\n",
    "\n",
    "data = [\n",
    "    opts.SunburstItem(\n",
    "        name=\"Grandpa\",\n",
    "        children=[\n",
    "            opts.SunburstItem(\n",
    "                name=\"Uncle Leo\",\n",
    "                value=15,\n",
    "                children=[\n",
    "                    opts.SunburstItem(name=\"Cousin Jack\", value=2),\n",
    "                    opts.SunburstItem(\n",
    "                        name=\"Cousin Mary\",\n",
    "                        value=5,\n",
    "                        children=[opts.SunburstItem(name=\"Jackson\", value=2)],\n",
    "                    ),\n",
    "                    opts.SunburstItem(name=\"Cousin Ben\", value=4),\n",
    "                ],\n",
    "            ),\n",
    "            opts.SunburstItem(\n",
    "                name=\"Father\",\n",
    "                value=10,\n",
    "                children=[\n",
    "                    opts.SunburstItem(name=\"Me\", value=5),\n",
    "                    opts.SunburstItem(name=\"Brother Peter\", value=1),\n",
    "                ],\n",
    "            ),\n",
    "        ],\n",
    "    ),\n",
    "    opts.SunburstItem(\n",
    "        name=\"Nancy\",\n",
    "        children=[\n",
    "            opts.SunburstItem(\n",
    "                name=\"Uncle Nike\",\n",
    "                children=[\n",
    "                    opts.SunburstItem(name=\"Cousin Betty\", value=1),\n",
    "                    opts.SunburstItem(name=\"Cousin Jenny\", value=2),\n",
    "                ],\n",
    "            )\n",
    "        ],\n",
    "    ),\n",
    "]\n",
    "\n",
    "sunburst = (\n",
    "    Sunburst(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\"))\n",
    "    .add(series_name=\"\", data_pair=data, radius=[0, \"90%\"])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Sunburst-基本示例\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "  #.render(\"map3d_china_base.html\")\n",
    ")\n",
    "sunburst.load_javascript()\n",
    "sunburst.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"76f4b29123d04502b566027b9ea36067\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_76f4b29123d04502b566027b9ea36067 = echarts.init(\n",
       "                    document.getElementById('76f4b29123d04502b566027b9ea36067'), 'white', {renderer: 'canvas'});\n",
       "                var option_76f4b29123d04502b566027b9ea36067 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"sunburst\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"Flora\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#da0d68\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Black Tea\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#975e6d\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Floral\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#e0719c\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Chamomile\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f99e1c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Rose\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#ef5a78\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Jasmine\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f7f1bd\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Fruity\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#da1d23\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Berry\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#dd4c51\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Blackberry\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#3e0317\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Raspberry\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#e62969\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Blueberry\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#6569b0\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Strawberry\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#ef2d36\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Dried Fruit\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#c94a44\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Raisin\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#b53b54\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Prune\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a5446f\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Other Fruit\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#dd4c51\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Coconut\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f2684b\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Cherry\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#e73451\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Pomegranate\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#e65656\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Pineapple\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f89a1c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Grape\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#aeb92c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Apple\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#4eb849\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Peach\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f68a5c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Pear\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#baa635\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Citrus Fruit\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#f7a128\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Grapefruit\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#f26355\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Orange\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#e2631e\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Lemon\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#fde404\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Lime\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#7eb138\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Sour/\\nFermented\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#ebb40f\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Sour\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#e1c315\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Sour Aromatics\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#9ea718\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Acetic Acid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#94a76f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Butyric Acid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#d0b24f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Isovaleric Acid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#8eb646\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Citric Acid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#faef07\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Malic Acid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#c1ba07\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Alcohol/\\nFremented\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#b09733\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Winey\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#8f1c53\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Whiskey\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#b34039\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Fremented\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#ba9232\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Overripe\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#8b6439\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Green/\\nVegetative\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#187a2f\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Olive Oil\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#a2b029\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Raw\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#718933\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Green/\\nVegetative\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#3aa255\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Under-ripe\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a2bb2b\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Peapod\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#62aa3c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Fresh\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#03a653\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Dark Green\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#038549\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Vegetative\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#28b44b\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Hay-like\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a3a830\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Herb-like\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#7ac141\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Beany\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#5e9a80\"\n",
       "                            }\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Other\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#0aa3b5\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Papery/Musty\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#9db2b7\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Stale\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#8b8c90\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Cardboard\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#beb276\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Papery\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#fefef4\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Woody\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#744e03\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Moldy/Damp\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a3a36f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Musty/Dusty\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#c9b583\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Musty/Earthy\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#978847\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Animalic\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#9d977f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Meaty Brothy\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#cc7b6a\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Phenolic\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#db646a\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Chemical\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#76c0cb\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Bitter\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#80a89d\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Salty\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#def2fd\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Medicinal\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#7a9bae\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Petroleum\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#039fb8\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Skunky\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#5e777b\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Rubber\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#120c0c\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Roasted\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#c94930\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Pipe Tobacco\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#caa465\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Tobacco\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#dfbd7e\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Burnt\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#be8663\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Acrid\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#b9a449\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Ashy\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#899893\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Smoky\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a1743b\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Brown, Roast\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#894810\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Cereal\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#ddaf61\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Grain\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#b7906f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Malt\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#eb9d5f\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Spices\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#ad213e\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Pungent\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#794752\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Pepper\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#cc3d41\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Brown Spice\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#b14d57\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Anise\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#c78936\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Nutmeg\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#8c292c\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Cinnamon\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#e5762e\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Clove\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#a16c5a\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Nutty/\\nCocoa\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#a87b64\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Nutty\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#c78869\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Peanuts\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#d4ad12\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Hazelnut\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#9d5433\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Almond\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#c89f83\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Cocoa\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#bb764c\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Chocolate\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#692a19\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Dark Chocolate\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#470604\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        }\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"Sweet\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"color\": \"#e65832\"\n",
       "                    },\n",
       "                    \"children\": [\n",
       "                        {\n",
       "                            \"name\": \"Brown Sugar\",\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#d45a59\"\n",
       "                            },\n",
       "                            \"children\": [\n",
       "                                {\n",
       "                                    \"name\": \"Molasses\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#310d0f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Maple Syrup\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#ae341f\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Caramelized\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#d78823\"\n",
       "                                    }\n",
       "                                },\n",
       "                                {\n",
       "                                    \"name\": \"Honey\",\n",
       "                                    \"value\": 1,\n",
       "                                    \"itemStyle\": {\n",
       "                                        \"color\": \"#da5c1f\"\n",
       "                                    }\n",
       "                                }\n",
       "                            ]\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Vanilla\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#f89a80\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Vanillin\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#f37674\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Overall Sweet\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#e75b68\"\n",
       "                            }\n",
       "                        },\n",
       "                        {\n",
       "                            \"name\": \"Sweet Aromatics\",\n",
       "                            \"value\": 1,\n",
       "                            \"itemStyle\": {\n",
       "                                \"color\": \"#d0545f\"\n",
       "                            }\n",
       "                        }\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                0,\n",
       "                \"95%\"\n",
       "            ],\n",
       "            \"highlightPolicy\": \"ancestor\",\n",
       "            \"nodeClick\": \"rootToNode\",\n",
       "            \"sort\": \"null\",\n",
       "            \"levels\": [\n",
       "                {},\n",
       "                {\n",
       "                    \"r0\": \"15%\",\n",
       "                    \"r\": \"35%\",\n",
       "                    \"itemStyle\": {\n",
       "                        \"borderWidth\": 2\n",
       "                    },\n",
       "                    \"label\": {\n",
       "                        \"rotate\": \"tangential\"\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"r0\": \"35%\",\n",
       "                    \"r\": \"70%\",\n",
       "                    \"label\": {\n",
       "                        \"align\": \"right\"\n",
       "                    }\n",
       "                },\n",
       "                {\n",
       "                    \"r0\": \"70%\",\n",
       "                    \"r\": \"72%\",\n",
       "                    \"label\": {\n",
       "                        \"position\": \"outside\",\n",
       "                        \"padding\": 3,\n",
       "                        \"silent\": false\n",
       "                    },\n",
       "                    \"itemStyle\": {\n",
       "                        \"borderWidth\": 3\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Sunburst-\\u5b98\\u65b9\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_76f4b29123d04502b566027b9ea36067.setOption(option_76f4b29123d04502b566027b9ea36067);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7fc7a8674da0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Sunburst\n",
    "from pyecharts import options as opts\n",
    "\n",
    "\"\"\"\n",
    "Gallery 使用 pyecharts 1.2.1\n",
    "参考地址: https://www.echartsjs.com/examples/editor.html?c=sunburst-simple\n",
    "\n",
    "目前无法实现的功能:\n",
    "\n",
    "1、暂无\n",
    "\"\"\"\n",
    "data = [\n",
    "    {\n",
    "        \"name\": \"Flora\",\n",
    "        \"itemStyle\": {\"color\": \"#da0d68\"},\n",
    "        \"children\": [\n",
    "            {\"name\": \"Black Tea\", \"value\": 1, \"itemStyle\": {\"color\": \"#975e6d\"}},\n",
    "            {\n",
    "                \"name\": \"Floral\",\n",
    "                \"itemStyle\": {\"color\": \"#e0719c\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Chamomile\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#f99e1c\"},\n",
    "                    },\n",
    "                    {\"name\": \"Rose\", \"value\": 1, \"itemStyle\": {\"color\": \"#ef5a78\"}},\n",
    "                    {\"name\": \"Jasmine\", \"value\": 1, \"itemStyle\": {\"color\": \"#f7f1bd\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Fruity\",\n",
    "        \"itemStyle\": {\"color\": \"#da1d23\"},\n",
    "        \"children\": [\n",
    "            {\n",
    "                \"name\": \"Berry\",\n",
    "                \"itemStyle\": {\"color\": \"#dd4c51\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Blackberry\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#3e0317\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Raspberry\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#e62969\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Blueberry\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#6569b0\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Strawberry\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#ef2d36\"},\n",
    "                    },\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Dried Fruit\",\n",
    "                \"itemStyle\": {\"color\": \"#c94a44\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Raisin\", \"value\": 1, \"itemStyle\": {\"color\": \"#b53b54\"}},\n",
    "                    {\"name\": \"Prune\", \"value\": 1, \"itemStyle\": {\"color\": \"#a5446f\"}},\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Other Fruit\",\n",
    "                \"itemStyle\": {\"color\": \"#dd4c51\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Coconut\", \"value\": 1, \"itemStyle\": {\"color\": \"#f2684b\"}},\n",
    "                    {\"name\": \"Cherry\", \"value\": 1, \"itemStyle\": {\"color\": \"#e73451\"}},\n",
    "                    {\n",
    "                        \"name\": \"Pomegranate\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#e65656\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Pineapple\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#f89a1c\"},\n",
    "                    },\n",
    "                    {\"name\": \"Grape\", \"value\": 1, \"itemStyle\": {\"color\": \"#aeb92c\"}},\n",
    "                    {\"name\": \"Apple\", \"value\": 1, \"itemStyle\": {\"color\": \"#4eb849\"}},\n",
    "                    {\"name\": \"Peach\", \"value\": 1, \"itemStyle\": {\"color\": \"#f68a5c\"}},\n",
    "                    {\"name\": \"Pear\", \"value\": 1, \"itemStyle\": {\"color\": \"#baa635\"}},\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Citrus Fruit\",\n",
    "                \"itemStyle\": {\"color\": \"#f7a128\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Grapefruit\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#f26355\"},\n",
    "                    },\n",
    "                    {\"name\": \"Orange\", \"value\": 1, \"itemStyle\": {\"color\": \"#e2631e\"}},\n",
    "                    {\"name\": \"Lemon\", \"value\": 1, \"itemStyle\": {\"color\": \"#fde404\"}},\n",
    "                    {\"name\": \"Lime\", \"value\": 1, \"itemStyle\": {\"color\": \"#7eb138\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Sour/\\nFermented\",\n",
    "        \"itemStyle\": {\"color\": \"#ebb40f\"},\n",
    "        \"children\": [\n",
    "            {\n",
    "                \"name\": \"Sour\",\n",
    "                \"itemStyle\": {\"color\": \"#e1c315\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Sour Aromatics\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#9ea718\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Acetic Acid\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#94a76f\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Butyric Acid\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#d0b24f\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Isovaleric Acid\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#8eb646\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Citric Acid\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#faef07\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Malic Acid\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#c1ba07\"},\n",
    "                    },\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Alcohol/\\nFremented\",\n",
    "                \"itemStyle\": {\"color\": \"#b09733\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Winey\", \"value\": 1, \"itemStyle\": {\"color\": \"#8f1c53\"}},\n",
    "                    {\"name\": \"Whiskey\", \"value\": 1, \"itemStyle\": {\"color\": \"#b34039\"}},\n",
    "                    {\n",
    "                        \"name\": \"Fremented\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#ba9232\"},\n",
    "                    },\n",
    "                    {\"name\": \"Overripe\", \"value\": 1, \"itemStyle\": {\"color\": \"#8b6439\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Green/\\nVegetative\",\n",
    "        \"itemStyle\": {\"color\": \"#187a2f\"},\n",
    "        \"children\": [\n",
    "            {\"name\": \"Olive Oil\", \"value\": 1, \"itemStyle\": {\"color\": \"#a2b029\"}},\n",
    "            {\"name\": \"Raw\", \"value\": 1, \"itemStyle\": {\"color\": \"#718933\"}},\n",
    "            {\n",
    "                \"name\": \"Green/\\nVegetative\",\n",
    "                \"itemStyle\": {\"color\": \"#3aa255\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Under-ripe\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#a2bb2b\"},\n",
    "                    },\n",
    "                    {\"name\": \"Peapod\", \"value\": 1, \"itemStyle\": {\"color\": \"#62aa3c\"}},\n",
    "                    {\"name\": \"Fresh\", \"value\": 1, \"itemStyle\": {\"color\": \"#03a653\"}},\n",
    "                    {\n",
    "                        \"name\": \"Dark Green\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#038549\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Vegetative\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#28b44b\"},\n",
    "                    },\n",
    "                    {\"name\": \"Hay-like\", \"value\": 1, \"itemStyle\": {\"color\": \"#a3a830\"}},\n",
    "                    {\n",
    "                        \"name\": \"Herb-like\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#7ac141\"},\n",
    "                    },\n",
    "                ],\n",
    "            },\n",
    "            {\"name\": \"Beany\", \"value\": 1, \"itemStyle\": {\"color\": \"#5e9a80\"}},\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Other\",\n",
    "        \"itemStyle\": {\"color\": \"#0aa3b5\"},\n",
    "        \"children\": [\n",
    "            {\n",
    "                \"name\": \"Papery/Musty\",\n",
    "                \"itemStyle\": {\"color\": \"#9db2b7\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Stale\", \"value\": 1, \"itemStyle\": {\"color\": \"#8b8c90\"}},\n",
    "                    {\n",
    "                        \"name\": \"Cardboard\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#beb276\"},\n",
    "                    },\n",
    "                    {\"name\": \"Papery\", \"value\": 1, \"itemStyle\": {\"color\": \"#fefef4\"}},\n",
    "                    {\"name\": \"Woody\", \"value\": 1, \"itemStyle\": {\"color\": \"#744e03\"}},\n",
    "                    {\n",
    "                        \"name\": \"Moldy/Damp\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#a3a36f\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Musty/Dusty\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#c9b583\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Musty/Earthy\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#978847\"},\n",
    "                    },\n",
    "                    {\"name\": \"Animalic\", \"value\": 1, \"itemStyle\": {\"color\": \"#9d977f\"}},\n",
    "                    {\n",
    "                        \"name\": \"Meaty Brothy\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#cc7b6a\"},\n",
    "                    },\n",
    "                    {\"name\": \"Phenolic\", \"value\": 1, \"itemStyle\": {\"color\": \"#db646a\"}},\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Chemical\",\n",
    "                \"itemStyle\": {\"color\": \"#76c0cb\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Bitter\", \"value\": 1, \"itemStyle\": {\"color\": \"#80a89d\"}},\n",
    "                    {\"name\": \"Salty\", \"value\": 1, \"itemStyle\": {\"color\": \"#def2fd\"}},\n",
    "                    {\n",
    "                        \"name\": \"Medicinal\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#7a9bae\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Petroleum\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#039fb8\"},\n",
    "                    },\n",
    "                    {\"name\": \"Skunky\", \"value\": 1, \"itemStyle\": {\"color\": \"#5e777b\"}},\n",
    "                    {\"name\": \"Rubber\", \"value\": 1, \"itemStyle\": {\"color\": \"#120c0c\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Roasted\",\n",
    "        \"itemStyle\": {\"color\": \"#c94930\"},\n",
    "        \"children\": [\n",
    "            {\"name\": \"Pipe Tobacco\", \"value\": 1, \"itemStyle\": {\"color\": \"#caa465\"}},\n",
    "            {\"name\": \"Tobacco\", \"value\": 1, \"itemStyle\": {\"color\": \"#dfbd7e\"}},\n",
    "            {\n",
    "                \"name\": \"Burnt\",\n",
    "                \"itemStyle\": {\"color\": \"#be8663\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Acrid\", \"value\": 1, \"itemStyle\": {\"color\": \"#b9a449\"}},\n",
    "                    {\"name\": \"Ashy\", \"value\": 1, \"itemStyle\": {\"color\": \"#899893\"}},\n",
    "                    {\"name\": \"Smoky\", \"value\": 1, \"itemStyle\": {\"color\": \"#a1743b\"}},\n",
    "                    {\n",
    "                        \"name\": \"Brown, Roast\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#894810\"},\n",
    "                    },\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Cereal\",\n",
    "                \"itemStyle\": {\"color\": \"#ddaf61\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Grain\", \"value\": 1, \"itemStyle\": {\"color\": \"#b7906f\"}},\n",
    "                    {\"name\": \"Malt\", \"value\": 1, \"itemStyle\": {\"color\": \"#eb9d5f\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Spices\",\n",
    "        \"itemStyle\": {\"color\": \"#ad213e\"},\n",
    "        \"children\": [\n",
    "            {\"name\": \"Pungent\", \"value\": 1, \"itemStyle\": {\"color\": \"#794752\"}},\n",
    "            {\"name\": \"Pepper\", \"value\": 1, \"itemStyle\": {\"color\": \"#cc3d41\"}},\n",
    "            {\n",
    "                \"name\": \"Brown Spice\",\n",
    "                \"itemStyle\": {\"color\": \"#b14d57\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Anise\", \"value\": 1, \"itemStyle\": {\"color\": \"#c78936\"}},\n",
    "                    {\"name\": \"Nutmeg\", \"value\": 1, \"itemStyle\": {\"color\": \"#8c292c\"}},\n",
    "                    {\"name\": \"Cinnamon\", \"value\": 1, \"itemStyle\": {\"color\": \"#e5762e\"}},\n",
    "                    {\"name\": \"Clove\", \"value\": 1, \"itemStyle\": {\"color\": \"#a16c5a\"}},\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Nutty/\\nCocoa\",\n",
    "        \"itemStyle\": {\"color\": \"#a87b64\"},\n",
    "        \"children\": [\n",
    "            {\n",
    "                \"name\": \"Nutty\",\n",
    "                \"itemStyle\": {\"color\": \"#c78869\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Peanuts\", \"value\": 1, \"itemStyle\": {\"color\": \"#d4ad12\"}},\n",
    "                    {\"name\": \"Hazelnut\", \"value\": 1, \"itemStyle\": {\"color\": \"#9d5433\"}},\n",
    "                    {\"name\": \"Almond\", \"value\": 1, \"itemStyle\": {\"color\": \"#c89f83\"}},\n",
    "                ],\n",
    "            },\n",
    "            {\n",
    "                \"name\": \"Cocoa\",\n",
    "                \"itemStyle\": {\"color\": \"#bb764c\"},\n",
    "                \"children\": [\n",
    "                    {\n",
    "                        \"name\": \"Chocolate\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#692a19\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Dark Chocolate\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#470604\"},\n",
    "                    },\n",
    "                ],\n",
    "            },\n",
    "        ],\n",
    "    },\n",
    "    {\n",
    "        \"name\": \"Sweet\",\n",
    "        \"itemStyle\": {\"color\": \"#e65832\"},\n",
    "        \"children\": [\n",
    "            {\n",
    "                \"name\": \"Brown Sugar\",\n",
    "                \"itemStyle\": {\"color\": \"#d45a59\"},\n",
    "                \"children\": [\n",
    "                    {\"name\": \"Molasses\", \"value\": 1, \"itemStyle\": {\"color\": \"#310d0f\"}},\n",
    "                    {\n",
    "                        \"name\": \"Maple Syrup\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#ae341f\"},\n",
    "                    },\n",
    "                    {\n",
    "                        \"name\": \"Caramelized\",\n",
    "                        \"value\": 1,\n",
    "                        \"itemStyle\": {\"color\": \"#d78823\"},\n",
    "                    },\n",
    "                    {\"name\": \"Honey\", \"value\": 1, \"itemStyle\": {\"color\": \"#da5c1f\"}},\n",
    "                ],\n",
    "            },\n",
    "            {\"name\": \"Vanilla\", \"value\": 1, \"itemStyle\": {\"color\": \"#f89a80\"}},\n",
    "            {\"name\": \"Vanillin\", \"value\": 1, \"itemStyle\": {\"color\": \"#f37674\"}},\n",
    "            {\"name\": \"Overall Sweet\", \"value\": 1, \"itemStyle\": {\"color\": \"#e75b68\"}},\n",
    "            {\"name\": \"Sweet Aromatics\", \"value\": 1, \"itemStyle\": {\"color\": \"#d0545f\"}},\n",
    "        ],\n",
    "    },\n",
    "]\n",
    "\n",
    "c = (\n",
    "    Sunburst(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\"))\n",
    "    .add(\n",
    "        \"\",\n",
    "        data_pair=data,\n",
    "        highlight_policy=\"ancestor\",\n",
    "        radius=[0, \"95%\"],\n",
    "        sort_=\"null\",\n",
    "        levels=[\n",
    "            {},\n",
    "            {\n",
    "                \"r0\": \"15%\",\n",
    "                \"r\": \"35%\",\n",
    "                \"itemStyle\": {\"borderWidth\": 2},\n",
    "                \"label\": {\"rotate\": \"tangential\"},\n",
    "            },\n",
    "            {\"r0\": \"35%\", \"r\": \"70%\", \"label\": {\"align\": \"right\"}},\n",
    "            {\n",
    "                \"r0\": \"70%\",\n",
    "                \"r\": \"72%\",\n",
    "                \"label\": {\"position\": \"outside\", \"padding\": 3, \"silent\": False},\n",
    "                \"itemStyle\": {\"borderWidth\": 3},\n",
    "            },\n",
    "        ],\n",
    "    )\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Sunburst-官方示例\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}\"))\n",
    "  #.render(\"map3d_china_base.html\")\n",
    ")\n",
    "c.load_javascript()\n",
    "c.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
